<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
<title>OFF the record</title>   
</head>
<body>
<c:import url="../common/top.jsp"></c:import>
<div class="container" style="margin: 60px;"></div>

<div class="container">
<div class="row">

<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>
<!--  -->
<div class="col-xs-8 col-sm-8 col-md-8- col-lg-8">
	<div class="name">
	<h2 align="center">공지사항</h2>
	</div>	
	
	<div class="notice-list">
		<div class="table-responsive">
			<table class="table table-hover">
				<thead>
					<tr>
						<th>#</th>
			            <th style="width: 100px;">작성자</th>
			            <th style="width: 400px;">제목</th>
			            <th>작성일자</th>
			            <th>조회수</th>
					</tr>
				</thead>
          
          <c:forEach var="notice" items="${ requestScope.noticeList.list }">
          <tbody>
            <tr>
              <td width="60">${ notice.noticeId }</td>
              <td width="60">${ notice.adminVo.adminId }</td>
              <td><a href="/OffTheRecord/getOneNotice.action?noticeId=${ notice.noticeId }">${ notice.noticeTitle }</a></td>
              <td width="120">${ notice.noticeWriteDate }</td>
              <td width="60">${ notice.noticeHits }</td>
            </tr>
          </tbody>
          </c:forEach>
        </table>
      </div><!-- /.table-responsive -->
      
<div class="col-lg-12" align="center">
<c:set var="pb" value="${ requestScope.noticeList.pagingBean }"/>

	<c:if test="${ pb.previousPageGroup }">
		<a href="/OffTheRecord/getAllNotice.action?pageNo=${ pb.startPageOfPageGroup-1 }">
		<img src="/OffTheRecord/img/left_arrow_btn.gif"></a>
	</c:if>
	
	<c:forEach var="i" begin="${ pb.startPageOfPageGroup }" end="${ pb.endPageOfPageGroup }">
		<c:choose>
			<c:when test="${ pb.nowPage!=i }">
			<a href="/OffTheRecord/getNoticeListByPage.action?pageNo=${i}">${i}</a>
			</c:when>
			<c:otherwise>
			${i}
			</c:otherwise>
		</c:choose>
		&nbsp;
	</c:forEach>

	<c:if test="${ pb.nextPageGroup }">
		<a href="/OffTheRecord/getNoticeListByPage.action?pageNo=${ pb.endPageOfPageGroup+1 }">
		<img src="/OffTheRecord/img/right_arrow_btn.gif"></a>
	</c:if><br><br>
</div>
	
	<c:if test="${ sessionScope.adminVo!=null }">
	<div style="float: right; margin-bottom: 50px;">
	<button class="btn btn-default" onclick="location.href='/OffTheRecord/admin/notice_write.jsp'">공지 작성</button>
	</div>
	</c:if>
    </div>

</div>
<!--  -->
<div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>

<div class="col-lg-12"></div>
</div><!-- row -->
</div><!-- container -->
</body>
</html>